3.5.20 \(\int \frac {(d+e x)^2}{a+c x^2} \, dx\)

Optimal. Leaf size=59 \[ \frac {\left (c d^2-a e^2\right ) \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{\sqrt {a} c^{3/2}}+\frac {d e \log \left (a+c x^2\right )}{c}+\frac {e^2 x}{c} \]

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {702, 635, 205, 260} \begin {gather*} \frac {\left (c d^2-a e^2\right ) \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{\sqrt {a} c^{3/2}}+\frac {d e \log \left (a+c x^2\right )}{c}+\frac {e^2 x}{c} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d + e*x)^2/(a + c*x^2),x]

[Out]

(e^2*x)/c + ((c*d^2 - a*e^2)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*c^(3/2)) + (d*e*Log[a + c*x^2])/c

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 702

Int[((d_) + (e_.)*(x_))^(m_)/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[PolynomialDivide[(d + e*x)^m, a + c*x^2,
x], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a*e^2, 0] && IGtQ[m, 1] && (NeQ[d, 0] || GtQ[m, 2])

Rubi steps

\begin {align*} \int \frac {(d+e x)^2}{a+c x^2} \, dx &=\int \left (\frac {e^2}{c}+\frac {c d^2-a e^2+2 c d e x}{c \left (a+c x^2\right )}\right ) \, dx\\ &=\frac {e^2 x}{c}+\frac {\int \frac {c d^2-a e^2+2 c d e x}{a+c x^2} \, dx}{c}\\ &=\frac {e^2 x}{c}+(2 d e) \int \frac {x}{a+c x^2} \, dx+\frac {\left (c d^2-a e^2\right ) \int \frac {1}{a+c x^2} \, dx}{c}\\ &=\frac {e^2 x}{c}+\frac {\left (c d^2-a e^2\right ) \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{\sqrt {a} c^{3/2}}+\frac {d e \log \left (a+c x^2\right )}{c}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 56, normalized size = 0.95 \begin {gather*} \frac {\left (c d^2-a e^2\right ) \tan ^{-1}\left (\frac {\sqrt {c} x}{\sqrt {a}}\right )}{\sqrt {a} c^{3/2}}+\frac {e \left (d \log \left (a+c x^2\right )+e x\right )}{c} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x)^2/(a + c*x^2),x]

[Out]

((c*d^2 - a*e^2)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*c^(3/2)) + (e*(e*x + d*Log[a + c*x^2]))/c

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(d+e x)^2}{a+c x^2} \, dx \end {gather*}

Verification is not applicable to the result.

[In]

IntegrateAlgebraic[(d + e*x)^2/(a + c*x^2),x]

[Out]

IntegrateAlgebraic[(d + e*x)^2/(a + c*x^2), x]

________________________________________________________________________________________

fricas [A]  time = 0.40, size = 137, normalized size = 2.32 \begin {gather*} \left [\frac {2 \, a c e^{2} x + 2 \, a c d e \log \left (c x^{2} + a\right ) + {\left (c d^{2} - a e^{2}\right )} \sqrt {-a c} \log \left (\frac {c x^{2} + 2 \, \sqrt {-a c} x - a}{c x^{2} + a}\right )}{2 \, a c^{2}}, \frac {a c e^{2} x + a c d e \log \left (c x^{2} + a\right ) + {\left (c d^{2} - a e^{2}\right )} \sqrt {a c} \arctan \left (\frac {\sqrt {a c} x}{a}\right )}{a c^{2}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)^2/(c*x^2+a),x, algorithm="fricas")

[Out]

[1/2*(2*a*c*e^2*x + 2*a*c*d*e*log(c*x^2 + a) + (c*d^2 - a*e^2)*sqrt(-a*c)*log((c*x^2 + 2*sqrt(-a*c)*x - a)/(c*
x^2 + a)))/(a*c^2), (a*c*e^2*x + a*c*d*e*log(c*x^2 + a) + (c*d^2 - a*e^2)*sqrt(a*c)*arctan(sqrt(a*c)*x/a))/(a*
c^2)]

________________________________________________________________________________________

giac [A]  time = 0.15, size = 52, normalized size = 0.88 \begin {gather*} \frac {d e \log \left (c x^{2} + a\right )}{c} + \frac {x e^{2}}{c} + \frac {{\left (c d^{2} - a e^{2}\right )} \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c} c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)^2/(c*x^2+a),x, algorithm="giac")

[Out]

d*e*log(c*x^2 + a)/c + x*e^2/c + (c*d^2 - a*e^2)*arctan(c*x/sqrt(a*c))/(sqrt(a*c)*c)

________________________________________________________________________________________

maple [A]  time = 0.04, size = 65, normalized size = 1.10 \begin {gather*} -\frac {a \,e^{2} \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c}\, c}+\frac {d^{2} \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c}}+\frac {d e \ln \left (c \,x^{2}+a \right )}{c}+\frac {e^{2} x}{c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)^2/(c*x^2+a),x)

[Out]

1/c*e^2*x+d*e*ln(c*x^2+a)/c-1/c/(a*c)^(1/2)*arctan(1/(a*c)^(1/2)*c*x)*a*e^2+1/(a*c)^(1/2)*arctan(1/(a*c)^(1/2)
*c*x)*d^2

________________________________________________________________________________________

maxima [A]  time = 2.97, size = 53, normalized size = 0.90 \begin {gather*} \frac {e^{2} x}{c} + \frac {d e \log \left (c x^{2} + a\right )}{c} + \frac {{\left (c d^{2} - a e^{2}\right )} \arctan \left (\frac {c x}{\sqrt {a c}}\right )}{\sqrt {a c} c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)^2/(c*x^2+a),x, algorithm="maxima")

[Out]

e^2*x/c + d*e*log(c*x^2 + a)/c + (c*d^2 - a*e^2)*arctan(c*x/sqrt(a*c))/(sqrt(a*c)*c)

________________________________________________________________________________________

mupad [B]  time = 0.30, size = 62, normalized size = 1.05 \begin {gather*} \frac {e^2\,x}{c}+\frac {d^2\,\mathrm {atan}\left (\frac {\sqrt {c}\,x}{\sqrt {a}}\right )}{\sqrt {a}\,\sqrt {c}}-\frac {\sqrt {a}\,e^2\,\mathrm {atan}\left (\frac {\sqrt {c}\,x}{\sqrt {a}}\right )}{c^{3/2}}+\frac {d\,e\,\ln \left (c\,x^2+a\right )}{c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d + e*x)^2/(a + c*x^2),x)

[Out]

(e^2*x)/c + (d^2*atan((c^(1/2)*x)/a^(1/2)))/(a^(1/2)*c^(1/2)) - (a^(1/2)*e^2*atan((c^(1/2)*x)/a^(1/2)))/c^(3/2
) + (d*e*log(a + c*x^2))/c

________________________________________________________________________________________

sympy [B]  time = 0.48, size = 185, normalized size = 3.14 \begin {gather*} \left (\frac {d e}{c} - \frac {\sqrt {- a c^{3}} \left (a e^{2} - c d^{2}\right )}{2 a c^{3}}\right ) \log {\left (x + \frac {- 2 a c \left (\frac {d e}{c} - \frac {\sqrt {- a c^{3}} \left (a e^{2} - c d^{2}\right )}{2 a c^{3}}\right ) + 2 a d e}{a e^{2} - c d^{2}} \right )} + \left (\frac {d e}{c} + \frac {\sqrt {- a c^{3}} \left (a e^{2} - c d^{2}\right )}{2 a c^{3}}\right ) \log {\left (x + \frac {- 2 a c \left (\frac {d e}{c} + \frac {\sqrt {- a c^{3}} \left (a e^{2} - c d^{2}\right )}{2 a c^{3}}\right ) + 2 a d e}{a e^{2} - c d^{2}} \right )} + \frac {e^{2} x}{c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)**2/(c*x**2+a),x)

[Out]

(d*e/c - sqrt(-a*c**3)*(a*e**2 - c*d**2)/(2*a*c**3))*log(x + (-2*a*c*(d*e/c - sqrt(-a*c**3)*(a*e**2 - c*d**2)/
(2*a*c**3)) + 2*a*d*e)/(a*e**2 - c*d**2)) + (d*e/c + sqrt(-a*c**3)*(a*e**2 - c*d**2)/(2*a*c**3))*log(x + (-2*a
*c*(d*e/c + sqrt(-a*c**3)*(a*e**2 - c*d**2)/(2*a*c**3)) + 2*a*d*e)/(a*e**2 - c*d**2)) + e**2*x/c

________________________________________________________________________________________